package com.itlong.cloud.equip.miniprogram;

import com.itlong.cloud.POJO.DTO.app.MiniScanQrCodePassDTO;
import com.itlong.cloud.POJO.VO.miniprogram.MiniProgramMyEquipListVO;
import com.itlong.cloud.POJO.VO.miniprogram.MiniProgramUserRoomInfoVO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceQRCodeInfoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *     小程序-我的-设备接口接口暴露。
 * <desc/>
 *
 * @createDate 2018/11/27.
 */
@FeignClient(name = "equip-service")
public interface IMiniProgramEquipServiceClient {

    /**
     * <desc>
     *      获取用户所有设备
     * </desc>
     *
     * @param userId 用户编号
     * @param projectId 项目编号
     * @return
     * @author Qiang.S
     * @createDate 2018/11/27
     */
    @RequestMapping(value = "/miniprogram/mine/myEquipInfo",method = RequestMethod.POST)
    List<MiniProgramMyEquipListVO> myEquipInfo(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取用户项目下的设备过期情况
     * </desc>
     *
     * @param userId 用户编号
     * @param projectId 项目编号
     * @return 1代表全部设备正常 2代表设备即将到期（0-3天） 3代表部分设备已过期3天 4代表全部设备已过期3天
     * @author Juguang.S
     * @createDate 2019/11/27
     */
    @RequestMapping(value = "/miniprogram/mine/getUserDeviceExpiredInfo",method = RequestMethod.POST)
    String getUserDeviceExpiredInfo(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取二维码相关信息，包含绑定的设备
     * </desc>
     *
     * @author wangzhi
     * @createDate 2020/02/26
     */
    @RequestMapping(value = "/miniProgram/mine/getQrCodeInfo", method = RequestMethod.POST)
    OperateDeviceQRCodeInfoVO getQrCodeInfo(@RequestBody MiniScanQrCodePassDTO miniScanQrCodePassDTO) throws Exception;

    /**
     * <desc>
     *      根据设备唯一码获取地址信息
     * </desc>
     *
     * @param deviceUnique 设备唯一码
     * @return
     * @author Juguang.S
     * @createDate 2020/03/24
     */
    @RequestMapping(value = "/miniprogram/mine/getAddressByDeviceUnique",method = RequestMethod.POST)
    List<MiniProgramUserRoomInfoVO> getAddressByDeviceUnique(@RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *      根据楼栋ID查询单元信息
     * </desc>
     *
     * @param buildId 楼栋ID
     * @return
     * @author Juguang.S
     * @createDate 2020/03/24
     */
    @RequestMapping(value = "/miniprogram/mine/getUnitInfoByBuildId",method = RequestMethod.POST)
    List<Map<String,String>> getUnitInfoByBuildId(@RequestParam("buildId") String buildId,@RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *      获取电梯的公共楼层
     * </desc>
     *
     * @author wangzhi
     * @createDate 2020/04/30
     */
    @RequestMapping(value = "/miniprogram/mine/getElevatorCommonFloor", method = RequestMethod.POST)
    Map<String,Object> getElevatorCommonFloor(@RequestParam("deviceUnique") String deviceUnique) throws Exception;
}
